export default {
  // mutations 唯一的目的就是修改state中状态
  // mutations 中的每个方法尽可能完成的事件比较单一一点
  addCounter(state, payload) {
    payload.count++;
  },
  addToCart(state, payload) {
    payload.checked = false;
    payload.count = 1;
    state.cartList.push(payload)
  },
  changeToClick(state, payload) {
    payload.checked = !payload.checked;
  }
}